package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.bean.app.dto.CouponRecordDto;
import com.yami.shop.bean.model.CouponRecord;
import com.yami.shop.bean.model.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CouponRecordMapper extends BaseMapper<CouponRecord> {
    List<CouponRecord> selectValidCoupon(CouponRecord couponRecord);

    List<CouponRecord> getByUserIdAndShopId(CouponRecord couponRecord);

    List<CouponRecordDto> selectUseCouponRecord(CouponRecord couponRecord);

    List<CouponRecordDto> getCouponAndRecord(Long recordId);

    void cancelOrders(@Param("orders") List<Order> orders);

    void returnCoupon(String orderNumber);

    CouponRecord getAvailableCouponByUserId(@Param("couponId") Long couponId,@Param("userId") String userId);

}
